/*
 * @Date: 2021-09-12 19:21:05
 * @Author: Acckno1
 * @LastEditTime: 2021-09-12 19:24:15
 * @Description: 
 */
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>

using namespace std;

int n, b;

int main() {
    cin >> n >> b;
    vector<int> v;
    
    // 计算n的b进制
    while (n) {
        int mod = n % b;
        v.push_back(mod);
        n /= b;
    }
    
    reverse(v.begin(), v.end());
    
    
    // 双指针判断是否是回文
    int i = 0, j = v.size() - 1;
    for (; i <= j; i ++, j -- ) 
        if(v[i] != v[j]) break;
    
    bool flag;
    if (i <= j) flag = false;
    else flag = true;
    
    
    if (flag) puts("Yes");
    else puts("No");
    
    
    for (int i = 0; i < v.size(); i ++ ) {
        if (!i) cout << v[i];
        else cout << " " << v[i];
    }
    cout << endl;
    
    return 0;
}